$(function() {
    if (getCookie('code') == 200 || getCookie('code') == 201 || getCookie('code') == 202 || getCookie('code') == 203) {
        $('.row-button').css("display", "none")
    } else {
        $('.panking').css("display", "none")
    }
})
$.get('http://111.229.120.67/gen/contribute-top', function(data) { //贡献
    console.log(data)
    if (data.statusCode == 0) {
        console.log(data)
        var datalist
        $.each(data.tops, function(i, n) {
            var x = i + 1;
            datalist = `
            <div class="panel panel-default">
            <div class="panel-heading" role="tab" id="heading` + n.name + `">
                <h4 class="panel-title collapsed" role="button"  data-parent="#accordion" href="#collapse` + n.name + `" aria-expanded="false" aria-controls="collapse` + n.name + `">
                    <a>
                    top` + x + `
                    </a>
                </h4>
            </div>
            <div id="collapse` + n.name + `" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading` + n.name + `">
                <div class="panel-body">
                <p> ` + n.name + ` </p>
                <p>` + n.subcount + `</p>
             
                </div>
            </div>
        </div> `
            $(".accr1").append(datalist)
                //贡献
        })
    }
})
$.get('http://111.229.120.67/gen/accuracy-top', function(data) { //正确
    console.log(data)
    if (data.statusCode == 0) {
        console.log(data)
        var datalist
        $.each(data.tops, function(i, n) {
            var x = i + 1;
            datalist = `<div class="panel panel-default">
            <div class="panel-heading" role="tab" id="heading` + x + `">
                <h4 class="panel-title collapsed" role="button"  data-parent="#accordion" href="#collapse` + x + `" aria-expanded="false" aria-controls="collapse` + x + `">
                    <a>top` + x + `</a>
                </h4>
            </div>
            <div id="collapse` + x + `" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="heading` + x + `">
                <div class="panel-body">
                <p> ` + n.name + ` </p>
                <p>` + n.accuracy + `</p>
                </div>
            </div>
        </div>`
            $(".accr2").append(datalist)




        })
    }
})